#include "physicssimulatordialog.h"
#include "ui_physicssimulatordialog.h"
#include "../application.h"
#include "../document.h"
#include "../gameobjects/graphicsobject.h"

PhysicsSimulatorDialog::PhysicsSimulatorDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::PhysicsSimulatorDialog)
{
    ui->setupUi(this);
    connect(ui->pushButtonClose, SIGNAL(clicked()), this, SLOT(accept()));

    populateGOCombo();
}

PhysicsSimulatorDialog::~PhysicsSimulatorDialog()
{
        delete ui;
}

void PhysicsSimulatorDialog::populateGOCombo()
{
    QPointer<Document> doc = Application::app().document();
    QList<QPointer<GraphicsObject> > gobjects = doc->graphicsObjects();

    foreach(QPointer<GraphicsObject> gobj, gobjects)
    {
        ui->comboBoxGObjects->addItem(gobj->id());
    }
}

